feat(wrangler): add Cloudflare Wrangler CLI support#138
feat(wrangler): add Cloudflare Wrangler CLI support#138sujito00 wants to merge 4 commits intortk-ai:masterfrom
Conversation
|
Nice work — this is a clean, well-structured PR. Good architecture with Clap subcommands, proper exit code propagation, error handling when wrangler isn't installed, and interactive Two things to fix before merge:
A few spots in wrangler_cmd.rs need formatting. Running cargo fmt should fix them automatically.
The known bindings detection block (~line 145-163) parses binding types but does nothing with them: if known_bindings.iter().any(|b| binding_type.trim() == *b) { This is a no-op — the actual work is done by extract_binding_types() called separately in filter_deploy_output. This block can be removed. A rebase on current master will also be needed since the branch is a few versions behind. Once these are addressed, this is good to merge. |
|
Thanks for the review feedback! Changes addressed:
Ready for re-review. Thanks! 🙏 |
Add wrangler command with compact output for Cloudflare Workers deployments: - `rtk wrangler deploy`: Compresses verbose deploy output to single status line with worker name, size, URLs, version, and warning summary - `rtk wrangler pages`: Compact pages deploy (file count + URL) - `rtk wrangler dev`: Passthrough with inherited I/O for interactive use - Other subcommands: transparent passthrough Features: - Strips wrangler banner and decorative output - Extracts and summarizes binding warnings (KV, D1, R2, DO, AI, etc.) - Deduplicates binding types in warning summary - Preserves error output and exit codes for CI/CD - Handles ANSI color code stripping - Handles edge cases: missing gzip size, no URLs, empty output Tests: 15 unit tests covering deploy, pages, errors, bindings, ANSI stripping, edge cases, and field extraction.
…o ARCHITECTURE.md
8777d8d to
a5e117f
Compare
Review: PR #138Thanks for the Wrangler code — the deploy/pages/dev/passthrough architecture is clean, 15 tests cover the key cases well, and the Clap subcommand structure is exactly right. However, the PR includes unrelated deletions that would cause regressions on master:
This likely happened during rebase conflict resolution — the merge deleted existing code instead of preserving it. Fix: Rebase cleanly on current master, keeping only the Wrangler additions ( The Wrangler code itself is solid — happy to merge once the unrelated changes are reverted! |
Summary
Adds
rtk wranglercommand for Cloudflare Workers CLI with compact, token-optimized output.Subcommands
rtk wrangler deployCompresses verbose deploy output into a compact status line:
Before (raw wrangler output ~15 lines):
After (rtk output ~5 lines, ~70% reduction):
rtk wrangler pagesCompact Cloudflare Pages deploy output:
rtk wrangler devPassthrough with inherited I/O (interactive dev server).
Other subcommands
Transparent passthrough for any unrecognized wrangler subcommand.
Features
Tests
15 unit tests covering:
Full test suite passes (353 tests including existing):
Motivation
Cloudflare Workers is a major deployment target. The verbose deploy output wastes significant tokens in LLM coding sessions, especially during iterative deploy-test cycles.